package com.wtp.wallpaper.controller.user;

import com.wtp.wallpaper.pojo.result.Result;
import com.wtp.wallpaper.service.NoticeItemService;
import com.wtp.wallpaper.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    @Autowired
    private NoticeItemService noticeItemService;

    @GetMapping("/wallNewsList")
    public Result wallNewsList(){
        return Result.success(noticeService.list());
    }

    @GetMapping("/wallNewsDetail")
    public Result wallNewsDetail(@RequestParam Long id){
        return Result.success(noticeItemService.getWallNewsDetailById(id));
    }
}
